package com.mushuilingfeng.ddd.user.domain.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 沐水淋风
 * @date 2024/10/5
 */
@AllArgsConstructor
@Getter
public enum LoginTypeEnum {
    PASSWORD(1, "密码登录"), QRCODE(2, "二维码登录"), WECHAT(3, "微信登录"),MOBILE(4, "手机号登录");
    private final int code;
    private final String desc;
    
    public static LoginTypeEnum get(int code) {
        for (LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()) {
            if (loginTypeEnum.getCode() == code) {
                return loginTypeEnum;
            }
        }
        return null;
    }
}
